#include "comm.hpp"


int main()
{
    std::cout<<"client begin"<<std::endl;
    int wfd = open(NAMED_PIPE,O_WRONLY);
    std::cout<<"client end"<<std::endl;
    if(wfd<0) exit(1);
    char buffer[1024];
    while(true)
    {
        std::cout<<"Please say# ";
        fgets(buffer,sizeof buffer,stdin);
        if(strlen(buffer)>0) 
            buffer[strlen(buffer)-1] = 0;
        ssize_t s = write(wfd,buffer,strlen(buffer));
        assert(s==strlen(buffer));
        (void)s;

    }
    close(wfd);
    return 0;
}
